package com.iss.lxhproject.controller;

import com.iss.lxhproject.model.MyResponseData;
import com.iss.lxhproject.model.RoomType;
import com.iss.lxhproject.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("roomtype/")
public class RoomTypeController {
    @Autowired
    private RoomTypeService service;
    @RequestMapping("selectAllRoomType")
    public MyResponseData selectAllRoomType(){
        MyResponseData responseData = new MyResponseData();
        List<RoomType> list = service.selectAllRoomType();
        responseData.setObjectList(list);
        responseData.setErrorCode(0);
        System.out.println(list);
        return responseData;
    }
}
